namespace Management.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class CreateTablePicture : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Pictures",
                c => new
                    {
                        PictureID = c.Int(nullable: false, identity: true),
                        Path = c.String(nullable: false),
                        ThumbPath = c.String(),
                        Remark = c.String(),
                        Model = c.String(),
                        PicType = c.Int(nullable: false),
                        Created_at = c.DateTime(nullable: false),
                        Updated_at = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.PictureID);
            
            AddColumn("dbo.Admins", "PictureID", c => c.Int(nullable: true));
            CreateIndex("dbo.Admins", "PictureID");
            AddForeignKey("dbo.Admins", "PictureID", "dbo.Pictures", "PictureID", cascadeDelete: true);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Admins", "PictureID", "dbo.Pictures");
            DropIndex("dbo.Admins", new[] { "PictureID" });
            DropColumn("dbo.Admins", "PictureID");
            DropTable("dbo.Pictures");
        }
    }
}
